export const userNameReg: RegExp = /(?<=.)./g;

export const phoneReg: RegExp = /(\d{3})\d{5}(\d{3})/;

export const encryptPhone = (phone: number | string) => {
  return String(phone).replace(phoneReg, "$1*****$2");
};

export const encryptUser = (user: string) => {
  return user.replace(userNameReg, "*");
};
export let encryptedEmail: RegExp = /([^@]+)/;

export function encryptEmail(email: string) {
  return email.replace(encryptedEmail, "**********");
}

export let passwordReg = /./g;

export const encryptPassword = (password: string): string => {
  return password.replace(passwordReg, "*");
};
